import React, { Component } from "react";
import { inject, observer } from "mobx-react";

@inject("appleBasket")
@observer
class AppleBtn extends Component {
  render() {
    const { appleBasket } = this.props;
    const { buttonText, isPicking, pickApple } = appleBasket
    return (
      <div className="btn-div">
        <button onClick={() => pickApple()} className={isPicking ? 'disabled' : ''}>{buttonText}</button>
      </div>
    );
  }
}

export default AppleBtn;
